/*
 * QTXpost - a Qt-based blog client.
 * Copyright (C) 2010 Helen Sommer
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; version 3 of the License.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program (in COPYING); if not, write to the
 * Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston,
 * MA  02111-1307  USA
 *
 * The project is hosted on http://code.google.com/p/qtxpost
 */

#ifndef SELECT_POST_H
#define SELECT_POST_H

#include <QtGui>
#include <QtCore>
#include <QtSql>

#include "ui_SelectPost.h"

class Server;

class SelectPost : public QDialog, private Ui::SelectPost 
{
  Q_OBJECT

    public:
  SelectPost(QWidget *parent = 0);
  QString lastDate;

  void add(int itemid, QString subject, QString eventtime, QString security, qulonglong allowmask, QString event, QString url, QString poster);
  void initialize(Server *server);
  void initializeProgress(int count);
  void completeProgress();
  void errorMessage(QString message);

 signals:
  void closed();

 private:
  QGridLayout *layout;
  QButtonGroup *buttonGroup;
  QCursor currentCursor;
  int target, count;
  int step;
  Server *server;
  QFont font;
  QPixmap lockedPixmap, filteredPixmap, privatePixmap;

  void initializeProgress();
  void incrementProgress();

  private slots:
  void select();
  void more();
  void dateUpdate();
  void cleanup();
};

#endif
